package protobuf {
	import com.netease.protobuf.*;
	use namespace com.netease.protobuf.used_by_generated_code;
	import com.netease.protobuf.fieldDescriptors.*;
	import flash.utils.Endian;
	import flash.utils.IDataInput;
	import flash.utils.IDataOutput;
	import flash.utils.IExternalizable;
	import flash.errors.IOError;
	import protobuf.TNMT_PLAYER_INFO;
	// @@protoc_insertion_point(imports)

	// @@protoc_insertion_point(class_metadata)
	public dynamic final class HSPKG_TNMT_PLAYERLIST_ACK extends com.netease.protobuf.Message {
		/**
		 *  @private
		 */
		public static const TOURNAMENT_ID:FieldDescriptor$TYPE_UINT64 = new FieldDescriptor$TYPE_UINT64("protobuf.HSPKG_TNMT_PLAYERLIST_ACK.tournament_id", "tournamentId", (1 << 3) | com.netease.protobuf.WireType.VARINT);

		public var tournamentId:UInt64;

		/**
		 *  @private
		 */
		public static const STARTPOS:FieldDescriptor$TYPE_UINT32 = new FieldDescriptor$TYPE_UINT32("protobuf.HSPKG_TNMT_PLAYERLIST_ACK.startpos", "startpos", (2 << 3) | com.netease.protobuf.WireType.VARINT);

		public var startpos:uint;

		/**
		 *  @private
		 */
		public static const TOTALPLAYER:FieldDescriptor$TYPE_UINT32 = new FieldDescriptor$TYPE_UINT32("protobuf.HSPKG_TNMT_PLAYERLIST_ACK.totalplayer", "totalplayer", (3 << 3) | com.netease.protobuf.WireType.VARINT);

		public var totalplayer:uint;

		/**
		 *  @private
		 */
		public static const PLAYERLIST:RepeatedFieldDescriptor$TYPE_MESSAGE = new RepeatedFieldDescriptor$TYPE_MESSAGE("protobuf.HSPKG_TNMT_PLAYERLIST_ACK.playerlist", "playerlist", (4 << 3) | com.netease.protobuf.WireType.LENGTH_DELIMITED, protobuf.TNMT_PLAYER_INFO);

		[ArrayElementType("protobuf.TNMT_PLAYER_INFO")]
		public var playerlist:Array = [];

		/**
		 *  @private
		 */
		public static const PLAYER_RANK:FieldDescriptor$TYPE_UINT32 = new FieldDescriptor$TYPE_UINT32("protobuf.HSPKG_TNMT_PLAYERLIST_ACK.player_rank", "playerRank", (5 << 3) | com.netease.protobuf.WireType.VARINT);

		public var playerRank:uint;

		/**
		 *  @private
		 */
		public static const FIRST_RANK:FieldDescriptor$TYPE_UINT32 = new FieldDescriptor$TYPE_UINT32("protobuf.HSPKG_TNMT_PLAYERLIST_ACK.first_rank", "firstRank", (6 << 3) | com.netease.protobuf.WireType.VARINT);

		public var firstRank:uint;

		/**
		 *  @private
		 */
		override used_by_generated_code final function writeToBuffer(output:com.netease.protobuf.WritingBuffer):void {
			com.netease.protobuf.WriteUtils.writeTag(output, com.netease.protobuf.WireType.VARINT, 1);
			com.netease.protobuf.WriteUtils.write$TYPE_UINT64(output, this.tournamentId);
			com.netease.protobuf.WriteUtils.writeTag(output, com.netease.protobuf.WireType.VARINT, 2);
			com.netease.protobuf.WriteUtils.write$TYPE_UINT32(output, this.startpos);
			com.netease.protobuf.WriteUtils.writeTag(output, com.netease.protobuf.WireType.VARINT, 3);
			com.netease.protobuf.WriteUtils.write$TYPE_UINT32(output, this.totalplayer);
			for (var playerlist$index:uint = 0; playerlist$index < this.playerlist.length; ++playerlist$index) {
				com.netease.protobuf.WriteUtils.writeTag(output, com.netease.protobuf.WireType.LENGTH_DELIMITED, 4);
				com.netease.protobuf.WriteUtils.write$TYPE_MESSAGE(output, this.playerlist[playerlist$index]);
			}
			com.netease.protobuf.WriteUtils.writeTag(output, com.netease.protobuf.WireType.VARINT, 5);
			com.netease.protobuf.WriteUtils.write$TYPE_UINT32(output, this.playerRank);
			com.netease.protobuf.WriteUtils.writeTag(output, com.netease.protobuf.WireType.VARINT, 6);
			com.netease.protobuf.WriteUtils.write$TYPE_UINT32(output, this.firstRank);
			for (var fieldKey:* in this) {
				super.writeUnknown(output, fieldKey);
			}
		}

		/**
		 *  @private
		 */
		override used_by_generated_code final function readFromSlice(input:flash.utils.IDataInput, bytesAfterSlice:uint):void {
			var tournament_id$count:uint = 0;
			var startpos$count:uint = 0;
			var totalplayer$count:uint = 0;
			var player_rank$count:uint = 0;
			var first_rank$count:uint = 0;
			while (input.bytesAvailable > bytesAfterSlice) {
				var tag:uint = com.netease.protobuf.ReadUtils.read$TYPE_UINT32(input);
				switch (tag >> 3) {
				case 1:
					if (tournament_id$count != 0) {
						throw new flash.errors.IOError('Bad data format: HSPKG_TNMT_PLAYERLIST_ACK.tournamentId cannot be set twice.');
					}
					++tournament_id$count;
					this.tournamentId = com.netease.protobuf.ReadUtils.read$TYPE_UINT64(input);
					break;
				case 2:
					if (startpos$count != 0) {
						throw new flash.errors.IOError('Bad data format: HSPKG_TNMT_PLAYERLIST_ACK.startpos cannot be set twice.');
					}
					++startpos$count;
					this.startpos = com.netease.protobuf.ReadUtils.read$TYPE_UINT32(input);
					break;
				case 3:
					if (totalplayer$count != 0) {
						throw new flash.errors.IOError('Bad data format: HSPKG_TNMT_PLAYERLIST_ACK.totalplayer cannot be set twice.');
					}
					++totalplayer$count;
					this.totalplayer = com.netease.protobuf.ReadUtils.read$TYPE_UINT32(input);
					break;
				case 4:
					this.playerlist.push(com.netease.protobuf.ReadUtils.read$TYPE_MESSAGE(input, new protobuf.TNMT_PLAYER_INFO()));
					break;
				case 5:
					if (player_rank$count != 0) {
						throw new flash.errors.IOError('Bad data format: HSPKG_TNMT_PLAYERLIST_ACK.playerRank cannot be set twice.');
					}
					++player_rank$count;
					this.playerRank = com.netease.protobuf.ReadUtils.read$TYPE_UINT32(input);
					break;
				case 6:
					if (first_rank$count != 0) {
						throw new flash.errors.IOError('Bad data format: HSPKG_TNMT_PLAYERLIST_ACK.firstRank cannot be set twice.');
					}
					++first_rank$count;
					this.firstRank = com.netease.protobuf.ReadUtils.read$TYPE_UINT32(input);
					break;
				default:
					super.readUnknown(input, tag);
					break;
				}
			}
		}

	}
}
